home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 7 / BBS in a Box - Macintosh - Volume VII (BBS in a Box) (January 1993).iso / Files / Art / I / Imagic.cpt / External Functions / Blank XFunction / myFunction.c < prev    next >
Text File  |  1992-03-30  |  3KB  |  94 lines

  1. /**************************************************************************************************
  2.  *                    myFunctions.c
  3.  *
  4.  *            This is the file where you (the programmer) will put your code.  The three functions
  5.  *        below are the skeletal parts of what you must fill in.  Just enter your code into each
  6.  *        corresponding function, compile, and link with the ImagicXFunction Library.  Then, you
  7.  *        are done.
  8.  *
  9.  *        See Documentation for further help.  All of your answers should be answered there.
  10.  *
  11.  *        For more complex and technical questions that the documentation could not answer,
  12.  * contact me, Brian Powell:
  13.  *
  14.  *                (E-Mail is the best way.  Preferably Internet)
  15.  *                Internet :   powellb@boulder.colorado.edu
  16.  *                AppleLink:   d3706
  17.  *
  18.  *                (If you have no other means...)                
  19.  *                Brian Powell
  20.  *                Colorado Center for Astrodynamics Research
  21.  *                University of Colorado at Boulder
  22.  *                Campus Box 431
  23.  *                Boulder, CO        80309
  24.  *                (303) 492-6677
  25.  *************************************************************************************************/
  26.  
  27. /* Include these files.
  28.  */
  29. #include "XFunctions.h"
  30.  
  31. /* Do any Definitions here.
  32.  */
  33.  
  34.  
  35. /* Declare any functions you may create here.
  36.  */
  37.  
  38. /* This is called whenever Imagic is beginning.  You set up your parameters here.  If there is
  39.  * anything you want to initialize, do that here.
  40.  */
  41. pascal OSErr Initialize(theParameters)
  42.     InitStruct *theParameters;
  43. {
  44.     OSErr theError = noErr;
  45.     
  46.     /* Insert Your Parameters Here.  If these parameters are fine with you, leave them, 
  47.      * otherwise set them up for your own needs.  This is also the default settings, so don't
  48.      * change it unless you need to. 
  49.      */
  50.      
  51.     theParameters->Filter = FALSE;
  52.     theParameters->NumOfImages = 1;
  53.     
  54.     /* Make sure that we are not goint to crash Imagic on startup with wrong calls. 
  55.      */
  56.     if (GetVersion() < EXTERNAL_FUNCTION_LIBRARY_VERSION_NUM) 
  57.         return (theError);
  58.         
  59.     /* Insert your initialization code here. 
  60.      */
  61.  
  62.     /* Let's go back to Imagic, giving it the parameters for our external module. */
  63.     return (theError);
  64. }
  65.  
  66. /* This function is called whenever the user selects your command from the menu.  This is the
  67.  * heart of your function.
  68.  */
  69. pascal OSErr ExecuteMenu()
  70. {
  71.     OSErr    theError=noErr;
  72.  
  73.     /* Insert your code here.
  74.      */
  75.      
  76.     return (theError);
  77. }
  78.  
  79. /* This function is called whenever Imagic quits.  If you need to clear anything up before it
  80.  * quits, do so here.
  81.  */
  82. pascal OSErr Exit()
  83. {
  84.     OSErr theError = noErr;
  85.     
  86.     /* Insert your shut-down code here.  Deallocate anything you may have left around, Do
  87.      * anything you may need to do as Imagic is quitting. 
  88.      */
  89.  
  90.     /* Let's let Imagic quit, returning an error that may have occured.
  91.      */
  92.     return (theError);
  93. }
  94.